#include <csignal>
#include <ros/ros.h>

#include "node/starlight_camera.hpp"

void sigintHandler(int sig)
{
  ROS_INFO("Shutting down...");
  ros::shutdown();
}

int main(int argc, char** argv){
    setlocale(LC_ALL,"");
    setlocale(LC_CTYPE, "zh_CN.utf8");

    ros::init(argc, argv, "starlight_camera_node");
    ros::NodeHandle nh;
    ros::NodeHandle nh_private("~");
    signal(SIGINT, sigintHandler);

    std::shared_ptr<WD::StarlightCamera> camera_ptr = std::make_shared<WD::StarlightCamera>(nh, nh_private);
    camera_ptr->initRos();
    camera_ptr->initCamera();
    camera_ptr->runStream();
    ros::spin();
    return 0;
}
